// pages/details/details.js
const config = require('../../config.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
		detailsData: {},
		detailsDataContent:''
  },
  onShow() {
    this.serviceContent(this.options.id)
  },
  // 获取服务详情
  serviceContent(id) {
    let vm = this
    wx.request({
      url: config.serviceInfo + '/' + id,
      data: {},
      header: {
        tenantId: 1003,
        'content-type': 'application/json', // 默认值
      },
      success(response) {
        console.log(response.data)
        let result = response.data
        if (result.code === '0000') {
          if (result.data) {
            let data = result.data.content.replace(/\<img/gi, '<img style="max-width:100% !important;height:auto"')
            vm.setData({
							detailsData:result.data,
              //富文本内容
              detailsDataContent: data
            })
          }
        }
      }
    })
  },
})
